// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import 'es6-promise/auto'
import 'font-awesome/css/font-awesome.css'
import Vue from 'vue'
// import VueRouter from 'vue-router'
import router from './routes'
import App from './App'
import components from 'src/components'
import filters from './filters'
import directives from './directives'
import store from './store'
import { sync } from 'vuex-router-sync'
sync(store, router)

// 全局 Mixins
import { globalMixins } from './mixins'

// 注册全局过滤器
// ------------------------------
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

// 注册自定义指令
// ------------------------------
Object.keys(directives).forEach(key => {
  Vue.directive(key, directives[key])
})

// 注册全局 Mixins
Vue.mixin(globalMixins)

// 注册全局组件
// ------------------------------
Vue.use(components)

/* eslint-disable no-new */
new Vue({
  el: '#app',
  template: '<App/>',
  components: { App },
  router,
  store
})
